// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Linq;
using Elastic.Clients.Elasticsearch.Serialization;

namespace Elastic.Clients.Elasticsearch.Cluster;

[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ComponentTemplateNodeConverter))]
public sealed partial class ComponentTemplateNode
{
	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public ComponentTemplateNode(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummary template)
	{
		Template = template;
	}
#if NET7_0_OR_GREATER
	public ComponentTemplateNode()
	{
	}
#endif
#if !NET7_0_OR_GREATER
	[System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")]
	public ComponentTemplateNode()
	{
	}
#endif
	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	internal ComponentTemplateNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel)
	{
		_ = sentinel;
	}

	/// <summary>
	/// <para>
	/// Date and time when the component template was created. Only returned if the <c>human</c> query parameter is <c>true</c>.
	/// </para>
	/// </summary>
	public System.DateTimeOffset? CreatedDate { get; set; }

	/// <summary>
	/// <para>
	/// Date and time when the component template was created, in milliseconds since the epoch.
	/// </para>
	/// </summary>
	public System.DateTimeOffset? CreatedDateMillis { get; set; }
	public bool? Deprecated { get; set; }
	public System.Collections.Generic.IDictionary<string, object>? Meta { get; set; }

	/// <summary>
	/// <para>
	/// Date and time when the component template was last modified. Only returned if the <c>human</c> query parameter is <c>true</c>.
	/// </para>
	/// </summary>
	public System.DateTimeOffset? ModifiedDate { get; set; }

	/// <summary>
	/// <para>
	/// Date and time when the component template was last modified, in milliseconds since the epoch.
	/// </para>
	/// </summary>
	public System.DateTimeOffset? ModifiedDateMillis { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummary Template { get; set; }
	public long? Version { get; set; }
}

public readonly partial struct ComponentTemplateNodeDescriptor<TDocument>
{
	internal Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode Instance { get; init; }

	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public ComponentTemplateNodeDescriptor(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode instance)
	{
		Instance = instance;
	}

	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public ComponentTemplateNodeDescriptor()
	{
		Instance = new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance);
	}

	public static explicit operator Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument>(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode instance) => new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument>(instance);
	public static implicit operator Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> descriptor) => descriptor.Instance;

	/// <summary>
	/// <para>
	/// Date and time when the component template was created. Only returned if the <c>human</c> query parameter is <c>true</c>.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> CreatedDate(System.DateTimeOffset? value)
	{
		Instance.CreatedDate = value;
		return this;
	}

	/// <summary>
	/// <para>
	/// Date and time when the component template was created, in milliseconds since the epoch.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> CreatedDateMillis(System.DateTimeOffset? value)
	{
		Instance.CreatedDateMillis = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> Deprecated(bool? value = true)
	{
		Instance.Deprecated = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> Meta(System.Collections.Generic.IDictionary<string, object>? value)
	{
		Instance.Meta = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> Meta()
	{
		Instance.Meta = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringObject.Build(null);
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> Meta(System.Action<Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringObject>? action)
	{
		Instance.Meta = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringObject.Build(action);
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> AddMeta(string key, object value)
	{
		Instance.Meta ??= new System.Collections.Generic.Dictionary<string, object>();
		Instance.Meta.Add(key, value);
		return this;
	}

	/// <summary>
	/// <para>
	/// Date and time when the component template was last modified. Only returned if the <c>human</c> query parameter is <c>true</c>.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> ModifiedDate(System.DateTimeOffset? value)
	{
		Instance.ModifiedDate = value;
		return this;
	}

	/// <summary>
	/// <para>
	/// Date and time when the component template was last modified, in milliseconds since the epoch.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> ModifiedDateMillis(System.DateTimeOffset? value)
	{
		Instance.ModifiedDateMillis = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> Template(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummary value)
	{
		Instance.Template = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> Template()
	{
		Instance.Template = Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor<TDocument>.Build(null);
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> Template(System.Action<Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor<TDocument>>? action)
	{
		Instance.Template = Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor<TDocument>.Build(action);
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument> Version(long? value)
	{
		Instance.Version = value;
		return this;
	}

	[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
	internal static Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode Build(System.Action<Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument>> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor<TDocument>(new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance));
		action.Invoke(builder);
		return builder.Instance;
	}
}

public readonly partial struct ComponentTemplateNodeDescriptor
{
	internal Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode Instance { get; init; }

	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public ComponentTemplateNodeDescriptor(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode instance)
	{
		Instance = instance;
	}

	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public ComponentTemplateNodeDescriptor()
	{
		Instance = new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance);
	}

	public static explicit operator Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode instance) => new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor(instance);
	public static implicit operator Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor descriptor) => descriptor.Instance;

	/// <summary>
	/// <para>
	/// Date and time when the component template was created. Only returned if the <c>human</c> query parameter is <c>true</c>.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor CreatedDate(System.DateTimeOffset? value)
	{
		Instance.CreatedDate = value;
		return this;
	}

	/// <summary>
	/// <para>
	/// Date and time when the component template was created, in milliseconds since the epoch.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor CreatedDateMillis(System.DateTimeOffset? value)
	{
		Instance.CreatedDateMillis = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor Deprecated(bool? value = true)
	{
		Instance.Deprecated = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor Meta(System.Collections.Generic.IDictionary<string, object>? value)
	{
		Instance.Meta = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor Meta()
	{
		Instance.Meta = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringObject.Build(null);
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor Meta(System.Action<Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringObject>? action)
	{
		Instance.Meta = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringObject.Build(action);
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor AddMeta(string key, object value)
	{
		Instance.Meta ??= new System.Collections.Generic.Dictionary<string, object>();
		Instance.Meta.Add(key, value);
		return this;
	}

	/// <summary>
	/// <para>
	/// Date and time when the component template was last modified. Only returned if the <c>human</c> query parameter is <c>true</c>.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor ModifiedDate(System.DateTimeOffset? value)
	{
		Instance.ModifiedDate = value;
		return this;
	}

	/// <summary>
	/// <para>
	/// Date and time when the component template was last modified, in milliseconds since the epoch.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor ModifiedDateMillis(System.DateTimeOffset? value)
	{
		Instance.ModifiedDateMillis = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor Template(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummary value)
	{
		Instance.Template = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor Template()
	{
		Instance.Template = Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor.Build(null);
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor Template(System.Action<Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor>? action)
	{
		Instance.Template = Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor.Build(action);
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor Template<T>(System.Action<Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor<T>>? action)
	{
		Instance.Template = Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor<T>.Build(action);
		return this;
	}

	public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor Version(long? value)
	{
		Instance.Version = value;
		return this;
	}

	[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
	internal static Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode Build(System.Action<Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeDescriptor(new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance));
		action.Invoke(builder);
		return builder.Instance;
	}
}